package com.kurt.service;

import com.kurt.dto.create.VehicleDriverCreateRequest;
import com.kurt.dto.create.VehicleDriverDTO;
import com.kurt.dto.query.VehicleDriverQueryRequest;
import com.kurt.entity.SysVehicleDriver;
import org.springframework.data.domain.Page;

import java.util.List;

/**
 * 车辆驾驶员关联服务接口
 */
public interface VehicleDriverService extends BaseService<SysVehicleDriver, Long> {

    /**
     * 绑定车辆和驾驶员
     *
     * @param createRequest 绑定请求
     * @return 绑定结果
     */
    VehicleDriverDTO bindVehicleDriver(VehicleDriverCreateRequest createRequest);

    /**
     * 解绑车辆和驾驶员
     *
     * @param vehicleId 车辆ID
     * @param driverId  驾驶员ID
     * @return 解绑结果
     */
    boolean unbindVehicleDriver(Long vehicleId, Long driverId);

    /**
     * 批量绑定车辆和驾驶员
     *
     * @param vehicleId 车辆ID
     * @param driverIds 驾驶员ID列表
     * @return 绑定结果
     */
    boolean bindVehicleDrivers(Long vehicleId, List<Long> driverIds, Long userId);

    /**
     * 批量解绑车辆和驾驶员
     *
     * @param vehicleId 车辆ID
     * @param driverIds 驾驶员ID列表
     * @return 解绑结果
     */
    boolean unbindVehicleDrivers(Long vehicleId, List<Long> driverIds);

    /**
     * 分页查询车辆驾驶员关联
     *
     * @param queryRequest 查询请求
     * @return 分页结果
     */
    Page<VehicleDriverDTO> getVehicleDriverPage(VehicleDriverQueryRequest queryRequest);

    /**
     * 查询车辆驾驶员关联列表
     *
     * @param queryRequest 查询请求
     * @return 关联列表
     */
    List<VehicleDriverDTO> getVehicleDriverList(VehicleDriverQueryRequest queryRequest);

    /**
     * 根据车辆ID获取绑定的驾驶员列表
     *
     * @param vehicleId 车辆ID
     * @return 驾驶员列表
     */
    List<VehicleDriverDTO> getDriversByVehicleId(Long vehicleId);

    /**
     * 根据驾驶员ID获取绑定的车辆列表
     *
     * @param driverId 驾驶员ID
     * @return 车辆列表
     */
    List<VehicleDriverDTO> getVehiclesByDriverId(Long driverId);

    /**
     * 检查车辆和驾驶员是否已绑定
     *
     * @param vehicleId 车辆ID
     * @param driverId  驾驶员ID
     * @return 是否已绑定
     */
    boolean isVehicleDriverBound(Long vehicleId, Long driverId);

}
